<?php

declare(strict_types=1);

namespace ImiApp\ApiServer\Api\Model\Base;

use Imi\Config\Annotation\ConfigValue;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Entity;
use Imi\Model\Annotation\Table;
use ImiApp\ImiServer\AbstractModel as Model;

/**
 * 运营中心激励金变动表 基类.
 *
 * @Entity(camel=false, bean=true, incrUpdate=false)
 * @Table(name=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\RunExciteMoneyLog.name", default="fa_run_excite_money_log"), usePrefix=false, id={"id"}, dbPoolName=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\RunExciteMoneyLog.poolName"))
 * @DDL(sql="CREATE TABLE `fa_run_excite_money_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `run_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '会员ID',
  `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更余额',
  `before` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更前余额',
  `after` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更后余额',
  `memo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '备注',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `typestatus_id` int(3) DEFAULT NULL COMMENT '类型',
  `public_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '公共id',
  `status` enum('0','1','2') COLLATE utf8mb4_unicode_ci DEFAULT '0' COMMENT '状态:0=未知,1=支出,2=收入',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='运营中心激励金变动表'", decode="")
 *
 * @property int|null $id 
 * @property int|null $runId 会员ID
 * @property string|float|int|null $money 变更余额
 * @property string|float|int|null $before 变更前余额
 * @property string|float|int|null $after 变更后余额
 * @property string|null $memo 备注
 * @property int|null $createtime 创建时间
 * @property int|null $typestatusId 类型
 * @property int|null $publicId 公共id
 * @property string|null $status 状态:0=未知,1=支出,2=收入
 */
abstract class RunExciteMoneyLogBase extends Model
{
    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEY = 'id';

    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEYS = ["id"];

    /**
     * id.
     * @Column(name="id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $id = NULL;

    /**
     * 获取 id.
     *
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * 赋值 id.
     * @param int|null $id id
     * @return static
     */
    public function setId($id)
    {
        $this->id = null === $id ? null : (int)$id;
        return $this;
    }

    /**
     * 会员ID.
     * run_id
     * @Column(name="run_id", type="int", length=10, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $runId = 0;

    /**
     * 获取 runId - 会员ID.
     *
     * @return int|null
     */
    public function getRunId(): ?int
    {
        return $this->runId;
    }

    /**
     * 赋值 runId - 会员ID.
     * @param int|null $runId run_id
     * @return static
     */
    public function setRunId($runId)
    {
        $this->runId = null === $runId ? null : (int)$runId;
        return $this;
    }

    /**
     * 变更余额.
     * money
     * @Column(name="money", type="decimal", length=10, accuracy=2, nullable=false, default="0.00", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $money = NULL;

    /**
     * 获取 money - 变更余额.
     *
     * @return string|float|int|null
     */
    public function getMoney()
    {
        return $this->money;
    }

    /**
     * 赋值 money - 变更余额.
     * @param string|float|int|null $money money
     * @return static
     */
    public function setMoney($money)
    {
        $this->money = null === $money ? null : $money;
        return $this;
    }

    /**
     * 变更前余额.
     * before
     * @Column(name="before", type="decimal", length=10, accuracy=2, nullable=false, default="0.00", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $before = NULL;

    /**
     * 获取 before - 变更前余额.
     *
     * @return string|float|int|null
     */
    public function getBefore()
    {
        return $this->before;
    }

    /**
     * 赋值 before - 变更前余额.
     * @param string|float|int|null $before before
     * @return static
     */
    public function setBefore($before)
    {
        $this->before = null === $before ? null : $before;
        return $this;
    }

    /**
     * 变更后余额.
     * after
     * @Column(name="after", type="decimal", length=10, accuracy=2, nullable=false, default="0.00", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $after = NULL;

    /**
     * 获取 after - 变更后余额.
     *
     * @return string|float|int|null
     */
    public function getAfter()
    {
        return $this->after;
    }

    /**
     * 赋值 after - 变更后余额.
     * @param string|float|int|null $after after
     * @return static
     */
    public function setAfter($after)
    {
        $this->after = null === $after ? null : $after;
        return $this;
    }

    /**
     * 备注.
     * memo
     * @Column(name="memo", type="varchar", length=255, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $memo = '';

    /**
     * 获取 memo - 备注.
     *
     * @return string|null
     */
    public function getMemo(): ?string
    {
        return $this->memo;
    }

    /**
     * 赋值 memo - 备注.
     * @param string|null $memo memo
     * @return static
     */
    public function setMemo($memo)
    {
        $this->memo = null === $memo ? null : (string)$memo;
        return $this;
    }

    /**
     * 创建时间.
     * createtime
     * @Column(name="createtime", type="bigint", length=16, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $createtime = NULL;

    /**
     * 获取 createtime - 创建时间.
     *
     * @return int|null
     */
    public function getCreatetime(): ?int
    {
        return $this->createtime;
    }

    /**
     * 赋值 createtime - 创建时间.
     * @param int|null $createtime createtime
     * @return static
     */
    public function setCreatetime($createtime)
    {
        $this->createtime = null === $createtime ? null : (int)$createtime;
        return $this;
    }

    /**
     * 类型.
     * typestatus_id
     * @Column(name="typestatus_id", type="int", length=3, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $typestatusId = NULL;

    /**
     * 获取 typestatusId - 类型.
     *
     * @return int|null
     */
    public function getTypestatusId(): ?int
    {
        return $this->typestatusId;
    }

    /**
     * 赋值 typestatusId - 类型.
     * @param int|null $typestatusId typestatus_id
     * @return static
     */
    public function setTypestatusId($typestatusId)
    {
        $this->typestatusId = null === $typestatusId ? null : (int)$typestatusId;
        return $this;
    }

    /**
     * 公共id.
     * public_id
     * @Column(name="public_id", type="int", length=10, accuracy=0, nullable=false, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $publicId = 0;

    /**
     * 获取 publicId - 公共id.
     *
     * @return int|null
     */
    public function getPublicId(): ?int
    {
        return $this->publicId;
    }

    /**
     * 赋值 publicId - 公共id.
     * @param int|null $publicId public_id
     * @return static
     */
    public function setPublicId($publicId)
    {
        $this->publicId = null === $publicId ? null : (int)$publicId;
        return $this;
    }

    /**
     * 状态:0=未知,1=支出,2=收入.
     * status
     * @Column(name="status", type="enum", length=0, accuracy=0, nullable=true, default="0", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $status = '0';

    /**
     * 获取 status - 状态:0=未知,1=支出,2=收入.
     *
     * @return string|null
     */
    public function getStatus(): ?string
    {
        return $this->status;
    }

    /**
     * 赋值 status - 状态:0=未知,1=支出,2=收入.
     * @param string|null $status status
     * @return static
     */
    public function setStatus($status)
    {
        $this->status = null === $status ? null : (string)$status;
        return $this;
    }

}
